home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / lgrind 1.0.1 / lgrindefs.man < prev    next >
Encoding:
Text File  |  1993-05-07  |  6.1 KB  |  199 lines  |  [TEXT/MPS ]

  1.  
  2.  
  3.  
  4.    9 September 1991                                              LGRINDEFS(5)
  5.  
  6.  
  7.  
  8.    NAME
  9.      lgrindefs - lgrind's language definition data base
  10.  
  11.    SYNOPSIS
  12.      /cs/src/lgrind/lgrindefs
  13.  
  14.    DESCRIPTION
  15.      lgrindefs contains all language definitions for lgrind(1).  The data
  16.      base is very similar to vgrind(5) and termcap(5), and it is upward-
  17.      compatible with that of vgrind(5).  Capabilities in lgrindefs are of two
  18.      types: Boolean capabilities which indicate that the language has some
  19.      particular feature and string capabilities which give a regular expres-
  20.      sion or keyword list.  Entries may continue onto multiple lines by giv-
  21.      ing a \ as the last character of a line.  Lines starting with # are com-
  22.      ments.
  23.  
  24.      Capabilities
  25.  
  26.      The following table names and describes each capability.
  27.  
  28.      Name  Type  Description
  29.      ab    str   Regular expression for the start of an alternate form com-
  30.                  ment
  31.      ae    str   Regular expression for the end of an alternate form comment
  32.      bb    str   Regular expression for the start of a block
  33.      be    str   Regular expression for the end of a lexical block
  34.      cb    str   Regular expression for the start of a comment
  35.      ce    str   Regular expression for the end of a comment
  36.      id    str   String giving characters other than letters and digits that
  37.                  may legally occur in identifiers (default `_')
  38.      kw    str   A list of keywords separated by spaces
  39.      lb    str   Regular expression for the start of a character constant
  40.      le    str   Regular expression for the end of a character constant
  41.      mb    str   Regular expression for the start of TeX math within a com-
  42.                  ment
  43.      me    str   Regular expression for the end of TeX math within a comment
  44.      oc    bool  Present means upper and lower case are equivalent
  45.      pb    str   Regular expression for start of a procedure
  46.      pl    bool  Procedure definitions are constrained to the lexical level
  47.                  matched by the `px' capability
  48.      px    str   A match for this regular expression indicates that procedure
  49.                  definitions may occur at the next lexical level.  Useful for
  50.                  lisp-like languages in which procedure definitions occur as
  51.                  subexpressions of defuns.
  52.      sb    str   Regular expression for the start of a string
  53.      se    str   Regular expression for the end of a string
  54.      tb    str   Regular expression for the start of TeX text within a com-
  55.                  ment
  56.      tc    str   Use the named entry as a continuation of this one
  57.      te    str   Regular expression for the end of TeX text within a comment
  58.      tl    bool  Present means procedures are only defined at the top lexical
  59.                  level
  60.      vb    str   Regular expression for the start of typewriter text within a
  61.  
  62.  
  63.                                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.    LGRINDEFS(5)                                              9 September 1991
  71.  
  72.  
  73.                  comment
  74.      ve    str   Regular expression for the end of typewriter text within a
  75.                  comment
  76.      zb    str   Regular expression for the start of program text within a
  77.                  comment
  78.      ze    str   Regular expression for the end of program text within a com-
  79.                  ment
  80.  
  81.      Regular Expressions
  82.  
  83.      lgrindefs uses regular expressions similar to those of ex(1) and lex(1).
  84.      The characters `^', `$', `|', `:', and `\' are reserved characters and
  85.      must be `quoted' with a preceding \ if they are to be included as normal
  86.      characters.  The metasymbols and their meanings are:
  87.  
  88.      $    The end of a line
  89.      ^    The beginning of a line
  90.      \d   A delimiter (space, tab, newline, start of line)
  91.      \a   Matches any string of symbols (like `.*' in lex)
  92.      \p   Matches any identifier.  In a procedure definition (the `pb' capa-
  93.           bility) the string that matches this symbol is used as the pro-
  94.           cedure name.
  95.      ()   Grouping
  96.      |    Alternation
  97.      ?    Last item is optional
  98.      \e   Preceding any string means that the string will not match an input
  99.           string if the input string is preceded by an escape character (\).
  100.           This is typically used for languages (like C) that can include the
  101.           string delimiter in a string by escaping it.
  102.  
  103.      Unlike other regular expressions in the system, these match words and
  104.      not characters.  Hence something like `(tramp|steamer)flies?' would
  105.      match `tramp', `steamer', `trampflies', or `steamerflies'.  Contrary to
  106.      some forms of regular expressions, lgrindef alternation binds very
  107.      tightly.  Grouping parentheses are likely to be necessary in expressions
  108.      involving alternation.
  109.  
  110.      Keyword List
  111.  
  112.      The keyword list is just a list of keywords in the language separated by
  113.      spaces.  If the `oc' boolean is specified, indicating that upper and
  114.      lower case are equivalent, then all the keywords should be specified in
  115.      lower case.
  116.  
  117.    EXAMPLE
  118.      The following entry, which describes the C language, is typical of a
  119.      language entry.
  120.  
  121.  
  122.           C|c|the C programming language:\
  123.                :pb=^\d?*?\d?\p\d??):bb={:be=}:cb=/*:ce=*/:\
  124.                :sb=":se=\e":lb=':le=\e':tl:\
  125.                :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\
  126.                :kw=asm auto break case char continue default do double\
  127.  
  128.  
  129.    2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.    9 September 1991                                              LGRINDEFS(5)
  137.  
  138.  
  139.                else enum extern float for fortran goto if int long\
  140.                register return short sizeof static struct switch typedef\
  141.                union unsigned while #define #else #endif #if #ifdef\
  142.                #ifndef #include #undef # define else endif if ifdef\
  143.                ifndef include undef:
  144.  
  145.      Note that the first field is just the language name (and any variants of
  146.      it).  Thus the C language could be specified to lgrind(1) as `c' or `C'.
  147.  
  148.    FILES
  149.      /cs/src/lgrind/lgrindefs   file containing terminal descriptions
  150.  
  151.    SEE ALSO
  152.      latex(1), lgrind(1), vgrindefs(5)
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                             3
  196.  
  197.  
  198.  
  199.